﻿using System;
using System.Collections.Generic;
using System.Text;
using VoteServices.VoteClass;

namespace VoteServices
{
    /// <summary>
    /// 投票操作
    /// </summary>
    public class Voting
    {
        public void Vote(int OptionId, User user)
        {

            VoteData.records.Add(new Record { OptionId = OptionId, VoteUser = user, VoteTime = DateTime.Now });
            VoteData.options.Find(o => o.Id == OptionId).Votes++;
        }
    }
}
